@import 'src/variables.less';

@map-loading-cls: ~'map-loading';

.@{map-loading-cls} {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  opacity: 0;
  background-color: #f2f4f6;
  pointer-events: none;
  transition: opacity 250ms @ease-in-out;
  z-index: 99;

  &.visible {
    opacity: 1;
  }

  &-anim {
    width: 1rem;
    aspect-ratio: 1;
    display: grid;
    border: 0.08rem solid transparent;
    border-radius: 50%;
    border-right-color: var(--panel-theme-color);
    animation: loading 1s infinite linear;

    &::before,
    &::after {
      content: '';
      grid-area: 1/1;
      margin: 0.04rem;
      border: inherit;
      border-radius: 50%;
      animation: loading 2s infinite;
    }
    &::after {
      margin: 0.16rem;
      animation-duration: 3s;
    }
  }

  &-text {
    margin-top: 0.32rem;
    font-size: 0.28rem;
    text-align: center;
    color: rgba(0, 0, 0, 0.7);
    opacity: 0.7;
  }
}

@keyframes loading {
  100% {
    transform: rotate(1turn);
  }
}
